/**
 * jquery中通用遍历方法each的实现
 */

 function each(obj,callback){
    let i = 0,length;
    if(isArrayLike(obj)){
      length = obj.length;
      for(;i<length;i++){
        if(callback.call(obj[i],i,obj[i]) === false){
          break;
        }
      }
    }else{
      for(i in obj){
        if(callback.call(obj[i],i,obj[i]) === false){
          break;
        }
      }
    };
    return obj;
 }
 //isArrayLike函数参考isArrayLike.js